home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Design
/
WB Collection.iso
/
workbench werkzeuge
/
bildschirmschoner
/
bserver_v1.5
/
sources.lha
/
Sources
/
server
/
askfiles.c
next >
Wrap
C/C++ Source or Header
|
1995-11-08
|
2KB
|
67 lines
#include <utility/tagitem.h>
#include <string.h>
#include <proto/exec.h>
#include <proto/asl.h>
#include <proto/dos.h>
#include "/include/server.h"
char drawername[77];
char filename[CLIENTNAME_MAXLENGTH];
struct TagItem sourcetags[] = {
{ ASLFR_TitleText, (ULONG)&"Select clients" },
{ ASLFR_InitialDrawer, (ULONG)drawername },
{ ASLFR_InitialFile, (ULONG)filename },
{ ASLFR_Flags1, FRF_DOMULTISELECT },
{ ASLFR_InitialHeight, 210L },
{ ASLFR_RejectIcons, TRUE },
{ TAG_END, NULL } };
extern void AddClient( char *, char *, char * );
extern void DetachGadgets( void );
extern void AttachGadgets( void );
struct Library *AslBase;
void AskFiles( void )
{
struct FileRequester *request;
UWORD x;
struct WBArg *asl_args;
if ( AslBase = OpenLibrary( "asl.library", 0L ) )
{
if ( request = (struct FileRequester *)AllocAslRequest( ASL_FileRequest, sourcetags ) )
{
strcpy( filename, FilePart(filename) );
if ( AslRequest( request, sourcetags ) )
{
DetachGadgets();
strcpy( filename, request->fr_Drawer );
if ( filename[0] )
{
strcpy( drawername, filename );
if ( filename[ strlen(filename)-1 ] != ':' && filename[ strlen(filename)-1 ] != '/' )
strcat( filename, "/" );
}
asl_args = request->fr_ArgList;
for ( x = 0; x < request->fr_NumArgs; x++ )
{
if ( request->fr_Drawer[0] )
*(FilePart(filename)) = 0;
else
filename[0] = 0;
strcat( filename, asl_args[x].wa_Name );
AddClient( FilePart(filename), filename, NULL );
}
AttachGadgets();
}
FreeAslRequest( request );
}
CloseLibrary( AslBase );
}
}